#!/usr/bin/python
#
# Copyright 2011 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""GIT config class

Defines the GIT config class to read/write the GIT system configuration.
"""

__author__ = 'Xin Zhou(zhounew@google.com)'

from git.config import config

class GitConfig:
  def __init__(self, loading_config_file=False):
    self.config_ = {};
    if loading_config_file:
      self.LoadConfigFile()
      pass
  
  def LoadConfigFile(self):
    for key in config.GIT_CONFIG:
      self.config_[key] = config.GIT_CONFIG[key]
  
  def Get(self, key):
    return self.config_[key]
  
  def Set(self, key, value):
    self.config_[key] = value
  
  def GetHomeUrl(self):
    return self.Get('homeUrl')
  
  def GetSignupUrl(self):
    return self.Get('signupUrl')
  
  def GetApiKey(self):
    return self.Get('apiKey')
  
  def GetAccountService(self):
    return self.Get('gitAccountServiceImpl')